package com.xuhai.blog19.admin.controller;

import com.xuhai.blog19.admin.entity.UserEntity;
import org.apache.shiro.SecurityUtils;

/**
 * @Author PangJunjie
 * @Date 2023/2/6/006
 */
public abstract class AbstractBaseController {
    protected UserEntity getUser() {
        return (UserEntity) SecurityUtils.getSubject().getPrincipal();
    }

    protected Integer getUserId() {
        return getUser() == null ? null : getUser().getUserId();
    }
}
